package ar.com.cooker.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
 * Objeto BO Tipo Receta 
 * @author c02536
 *
 */
@Entity
@Table(name = "ck_Recipe_Type")
public class RecipeType implements Serializable{

	private static final long serialVersionUID = 3341549642480995533L;

	@Id
	@Column(name = "id_recipe_type")
	private Integer id;
	
	@Column(length = 100)
	private String description;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = SubRecipeType.class)
	@JoinColumn(name = "id_recipe_type_fk", referencedColumnName = "id_recipe_type")
	private Set<SubRecipeType> subRecipeTypes;
	
	public RecipeType() {
	}

	public RecipeType(Integer id,String description) {
		this.description = description;
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setSubRecipeTypes(Set<SubRecipeType> subRecipeTypes) {
		this.subRecipeTypes = subRecipeTypes;
	}

	public Set<SubRecipeType> getSubRecipeTypes() {
		return subRecipeTypes;
	}

}
